import java.util.*;

/**
 * @author LKQ
 * @date 2022/5/13 10:46
 * @description 动态规划 01背包 TLE
 */
public class Solution {
    public static void main(String[] args) {

    }

    public int maxIceCream(int[] costs, int coins) {
        int[] dp = new int[coins + 1];
        int n = costs.length;
        for (int i = 0; i < n; i++) {
            for (int j = coins; j >= costs[i]; j--) {
                dp[j] = Math.max(dp[j], dp[j - costs[i]] + 1);
            }
        }
        return dp[coins];
    }
}
